
//------------------------------------------------------------------------------------------------------------------------------------------
#include<conio.h>
#include<stdio.h>

void main()
{

	int a[15];
        int n, i, j, temp, count;
        char cAns;
	
	do
	{
        	clrscr();
		printf("Enter n: ");
		scanf("%d", &n);
        
		//array input

		for (i = 0; i < n; i++)
		{
			printf("a[%d]= ",i);
	                scanf("%d",&a[i]);
		}


                //count = 0;
		for (i = 0; i < n; i++)
			for (j = i + 1; j < n; j++)
			{
				if (a[i] > a[j])
				{
					temp = a[i];
					a[i] = a[j];
					a[j] = temp;                        	
				}


        	        }

		

		printf("\n");		
	        for (i = 0;i < n;i++ )
			printf("%d ",a[i]);

		printf("\nThe largest number is: %d", a[n-1]);

		printf("\n\nContinue...?(Y/N)");
		cAns = getch();
		printf("%c",cAns);

		
		getch();



        } while (cAns == 'y' || cAns == 'Y');
}


	


